package com.gitee.wsl.struct.table.mini.dsl

import com.gitee.wsl.struct.table.mini.BorderStyle
import com.gitee.wsl.struct.table.mini.TableStyle

@PicnicDsl
interface TableStyleDsl {
    var border: Boolean?
    var borderStyle: BorderStyle?
}

internal class TableStyleDslImpl : TableStyleDsl {
    override var border: Boolean? = null
    override var borderStyle: BorderStyle? = null

    fun createOrNull(): TableStyle? {
        if (border != null || borderStyle != null) {
            return TableStyle {
                border = this@TableStyleDslImpl.border
                borderStyle = this@TableStyleDslImpl.borderStyle
            }
        }
        return null
    }
}